<%@page import="com.crm.entity.Business,com.crm.entity.User" %>
<%@ page language="java" session="true" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link href="<%=application.getContextPath()%>/css/css-crm.css" rel="stylesheet" type="text/css" /> 
<link rel="stylesheet" href="<%=application.getContextPath()%>/css/jquery.alerts.css" type="text/css"></link>
<script type="text/javascript" src="<%=application.getContextPath()%>/js/jquery.alerts.js"></script>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib  uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<script type="text/javascript"/>
<!--
function MM_swapImgRestore() { 
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { 
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { 
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


function MM_swapImage() { 
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<style >
.ui-dialog {
	
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	}
</style >	
<title>ASCRM</title>
</head>

<body>
<div id="header">
<%-- <%
	User us=(User)session.getAttribute("user");
int role=us.getRole();
if(role!=4){
    %> --%>
    <div class="logo"><a href="<%= application.getContextPath()%>/totalReports/show.do"><img src="<%= application.getContextPath()%>/images/logo.jpg" /></a></div>
	<%-- <%
	}else{
	%> --%>
	 <%-- <div class="logo"><a href="#"><img src="<%= application.getContextPath()%>/images/logo.jpg" /></a></div> --%>
	<%--  <%
	 }
%> --%>
    <div id="mainmenu">
    <%-- <%
    
    if(role==1 || role==2){
    %> --%>
      <div class="menutab"><a href="<%= application.getContextPath()%>/adminhome/open.do" title="Click To Open The Admin Panel" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image6','','<%= application.getContextPath()%>/images/admin-r.jpg',1)"><% if(request.getAttribute("menuName").equals("admin")){ %><img src="<%= application.getContextPath()%>/images/admin-r.jpg" name="Image6" width="55" height="63" border="0" id="Image6" /><%}else { %><img src="<%= application.getContextPath()%>/images/admin.jpg" name="Image6" width="55" height="63" border="0" id="Image6" /><%} %></a></div>
      <%-- <%
    }
     if(role==1 || role==2){
    %> --%>
	  <div class="menutab"><a href="<%= application.getContextPath()%>/newEnq/open.do" title="Click To Open The Enquiry Panel" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image7','','<%= application.getContextPath()%>/images/enquiry-r.jpg',1)"><% if(request.getAttribute("menuName").equals("enquiry")){ %><img src="<%= application.getContextPath()%>/images/enquiry-r.jpg" name="Image7" width="55" height="61" border="0" id="Image7" /><%}else { %><img src="<%= application.getContextPath()%>/images/enquiry.jpg" name="Image7" width="55" height="61" border="0" id="Image7" /><%} %></a></div>
	  <%-- <%
    }
     if(role==1 || role==2 || role==3){
	  %> --%>
	  <div class="menutab"><a href="<%= application.getContextPath()%>/exportsource/open.do" title="Click To Open The Sourcing Panel" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image7','','<%= application.getContextPath()%>/images/sourcing.jpg',1)"><% if(request.getAttribute("menuName").equals("sourcingInfo")){ %><img src="<%= application.getContextPath()%>/images/sourcing-r.jpg" name="Image7" width="55" height="61" border="0" id="Image7" /><%}else { %><img src="<%= application.getContextPath()%>/images/sourcing.jpg" name="Image7" width="55" height="61" border="0" id="Image7" /><%} %></a></div>
	  <%-- <%
     	}
     if(role==1 || role==2 || role==3){
	  %> --%>
	  <div class="menutab"><a href="<%= application.getContextPath()%>/newquot/show.do" title="Click To Open The Quotation Panel" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image10','','<%= application.getContextPath()%>/images/quotaion-r.jpg',1)"><% if(request.getAttribute("menuName").equals("quotation")){ %><img src="<%= application.getContextPath()%>/images/quotaion-r.jpg" name="Image10" width="59" height="61" border="0" id="Image10" /><%}else { %><img src="<%= application.getContextPath()%>/images/quotaion.jpg" name="Image10" width="55" height="61" border="0" id="Image10" /><%} %></a></div>
	  <%-- <%
     }
     if(role==1 || role==2 || role==3){
	  %> --%>
	  <div class="menutab"><a href="<%= application.getContextPath()%>/supplyOrder/show.do" title="Click To Open The Orders Panel" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image11','','<%= application.getContextPath()%>/images/orders-r.jpg',1)"><% if(request.getAttribute("menuName").equals("orders")){ %><img src="<%= application.getContextPath()%>/images/orders-r.jpg" name="Image11" width="58" height="61" border="0" id="Image11" /><%}else { %><img src="<%= application.getContextPath()%>/images/orders.jpg" name="Image10" width="55" height="61" border="0" id="Image11" /><%} %></a></div>
	  <%-- <%
     }
     if(role==1 || role==2 || role==3){
	  %> --%>
	  <div class="menutab"><a href="<%= application.getContextPath()%>/suppInvoice/show.do" title="Click To Open The SupplierInvoice Panel" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image8','','<%= application.getContextPath()%>/images/invoice-r.jpg',1)"><% if(request.getAttribute("menuName").equals("invoice")){ %><img src="<%= application.getContextPath()%>/images/invoice-r.jpg" name="Image8" width="58" height="61" border="0" id="Image8" /><%}else{ %><img src="<%= application.getContextPath()%>/images/invoice.jpg" name="Image8" width="58" height="61" border="0" id="Image8" /><%} %></a></div>
	  <%-- <%
     }
     if(role==1 || role==2 || role==3){
	  %> --%>
	  <div class="menutab"><a href="<%= application.getContextPath()%>/totalReports/show.do" title="Click To Open The Reports Panel" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image9','','<%= application.getContextPath()%>/images/reports-r.jpg',1)"><% if(request.getAttribute("menuName").equals("reports")){ %><img src="<%= application.getContextPath()%>/images/reports-r.jpg" name="Image9" width="55" height="61" border="0" id="Image9" /><%}else { %><img src="<%= application.getContextPath()%>/images/reports.jpg" name="Image9" width="55" height="61" border="0" id="Image9" /><%} %></a></div>
	  <%-- <%
     }
	  %> --%>
	  
	  
    </div>
	
    <div class="header-icons"><table width="300" border="0" align="right" cellpadding="0" cellspacing="0">
  <tr>
    <td width="" height="13"></td>
    </tr>
  <tr>
    <td align="right" ><table  border="0" align="right" cellpadding="0" cellspacing="0">
      <tr>
      <%-- <%
      if(role!=4){
      %> --%>
        <td width="41"><a href="<%= application.getContextPath()%>/totalReports/show.do" title="Click To Go Back To Home" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image2','','<%= application.getContextPath()%>/images/sublink1-r.jpg',1)"><img src="<%= application.getContextPath()%>/images/sublink1.jpg" name="Image2" width="37" height="33" border="0" id="Image2" /></a></td>
        <%-- <%
      }
        %> --%>
        <td width="66"><a href="<%= application.getContextPath()%>/account/show.do" title="Click To see Your Account details" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image3','','<%= application.getContextPath()%>/images/sublink2-r.jpg',1)"><img src="<%= application.getContextPath()%>/images/sublink2.jpg" name="Image3" width="64" height="34" border="0" id="Image3" /></a></td>
        <%-- <%
        if(role==1 || role==2){
        %> --%>
        <td width="51"><a href="<%= application.getContextPath()%>/variables/show.do" title="Opens Variables page like CVD,BCD.." onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image4','','<%= application.getContextPath()%>/images/sublink3-r.jpg',1)"><img src="<%= application.getContextPath()%>/images/sublink3.jpg" name="Image4" width="51" height="33" border="0" id="Image4" /></a></td>
        <%-- <%
        }
        %> --%>
        <td width="47"><a href="<%= application.getContextPath()%>/business/logout.do" title="Click To Logout Of ACRM" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image5','','<%= application.getContextPath()%>/images/sublink4-r.jpg',1)"><img src="<%= application.getContextPath()%>/images/sublink4.jpg" name="Image5" width="47" height="33" border="0" id="Image5" /></a></td>
      </tr>
      
    </table></td>
    </tr>
   
  <tr>
    <td height="10"></td>
  </tr>
  <tr>
  <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <%-- <%
    if(role!=4){
    %> --%><td width="61%"><div class="over-but" id="showdiv1"><img src="<%= application.getContextPath()%>/images/search-b.png" width="69" height="20" />
    <%-- <%}else{ %> --%>
    &nbsp;
    <%-- <%} %> --%>
<div class="over-main" id="showdiv"  style="display:none;">
  <div class="over-top"><img src="<%= application.getContextPath()%>/images/over-top.png" width="206" height="12" /></div>
  
  <div class="over-mid">
      <a href="#" onclick="javascript:retrivePart()"><span class="over-part-icon">Part</span></a>
	   <a href="#" onclick="javascript:retriveEnq()"><span class="over-enq-icon">Enquiry</span></a>
	  <a href="#" onclick="javascript:retriveQuot()"><span class="over-qut-icon">Quotation</span></a>
	  <a href="<%=application.getContextPath() %>/search/mainSearchShow.do" ><span class="over-qut-icon">History</span></a>
	  <a href="<%=application.getContextPath() %>/adminhome/history.do" ><span class="over-qut-icon">All History</span></a>
    </div>
  <div class="over-top"><img src="<%= application.getContextPath()%>/images/over-bt.png" width="206" height="12" /></div>
</div></div>
    <td width="39%" ><!-- <span class="button" id="clockId"> -->&nbsp;</span></td>
  
  </tr>
</table></td>
    </tr>   
</table>
</div>

  </div>
  <div id="partDialog"   title="Search By Parts" style="display: none;">
                  <div id="partSearchBox"></div>

</div>
  <div id="quotDialog"   title="Search By Quotations" style="display: none;">
                  <div id="quotSearchBox"></div>
        </div>
         <div id="enqDialog"   title="Search By Enquiry" style="display: none;">
                  <div id="enqSearchBoxid" class="boxtable"></div>
        </div>
         <div id="HistotyDialog"   title="Part History" style="display: none;">
                  <div id="HistoryDialogId" class="boxtable"></div>
        </div>
 <%@include file="slide.jsp" %>
    
</body>
</html>
<script type="text/javascript">
		$("#showdiv1").hover(function() {
			//alert("hover is clicked");
			$("#showdiv").slideDown(50).css('display', 'block');
   /*  $("#showdiv").slideDown().css('display', 'absolute'); */
}, function() {
    $("#showdiv").slideUp(50);
});
</script>
<script type="text/javascript">
function retrivePart(){
	
	$.ajax({
		url:" <%=application.getContextPath()%>/jsp/searchByPart.jsp",
		mimetype: "text/html",
		cache:false,
		success: function(res){
			$("#partSearchBox").html(res);	
		}
	});
	var $dialog = $('#partDialog').dialog({
        autoOpen: false,
        modal: true,
        width: 790,
        height: 400
      				
    });
		 
    $dialog.dialog('open');
	
}
</script>

<script  type="text/javascript">
function retriveEnq(){
	
	$.ajax({
		url:" <%=application.getContextPath()%>/jsp/searchEnquiry.jsp",
		mimetype: "text/html",
		cache:false,
		success: function(res){
			
			$("#enqSearchBoxid").html(res);
			
		}

	});

var $dialog = $('#enqDialog').dialog({
                autoOpen: false,
                modal: true,
                width: 970,
                height: 500
              				
            });
 			 
            $dialog.dialog('open');
}
	
    </script>
<script type="text/javascript">
	function retriveQuot(){
		
		$.ajax({
			url:" <%=application.getContextPath()%>/jsp/searchByQuot.jsp",
			mimetype: "text/html",
			cache:false,
			success: function(res){
				$("#quotSearchBox").html(res);	
			}
		});

	var $dialog = $('#quotDialog').dialog({
        autoOpen: false,
        modal: true,
        width: 790,
        height: 400
      				
    });
		 
    $dialog.dialog('open');
}
	
</script>
<script type="text/javascript">
	function retriveHistory(){
		
		$.ajax({
			url:" <%=application.getContextPath()%>/jsp/search.jsp",
			mimetype: "text/html",
			cache:false,
			success: function(res){
				$("#HistoryDialogId").html(res);	
			}
		});

	var $dialog = $('#HistotyDialog').dialog({
        autoOpen: false,
        modal: true,
        width: 900,
        height:600
      				
    });
		 
    $dialog.dialog('open');
}
	
</script>